//
//  VisitorView.swift
//  CJPWB
//
//  Created by 陈锦彭 on 16/3/13.
//  Copyright © 2016年 chenjinpeng. All rights reserved.
//

import UIKit

class VisitorView: UIView {

    //设置属性相关
    @IBOutlet weak var roationView: UIImageView!
    @IBOutlet weak var iconView: UIImageView!
    @IBOutlet weak var textLabel: UILabel!
    @IBOutlet weak var registerBtn: UIButton!
    @IBOutlet weak var LoginBtn: UIButton!
    
    //加载访客视图
    class func visitorView() -> VisitorView {
    return NSBundle.mainBundle().loadNibNamed("VisitorView", owner: nil, options: nil).first as! VisitorView
    }
    
    //设置视图内容
    func setupVisitorView(imageName : String, textString : String) {
        iconView.image = UIImage(named: imageName)
        textLabel.text = textString
        roationView.hidden = true
    }
    
    //转盘旋转
     func roationViewToRoation() {
        
        let base :CABasicAnimation = CABasicAnimation(keyPath: "transform.rotation.z")
        base.fromValue = 0
        base.toValue = M_PI * 2
        base.repeatCount = MAXFLOAT
        base.duration = 10
        base.removedOnCompletion = false
        roationView.layer.addAnimation(base, forKey: nil)
        
    }
 
}